﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace iemtm.WeChat.Core.Managers
{
    public interface IInfoManager
    {
        /// <summary>
        /// 获取公司信息
        /// </summary>
        /// <param name="Code"></param>
        /// <returns></returns>
        Task<Company> GetCompanyByCodeAsync(string Code);

        /// <summary>
        /// 获取基站信息
        /// </summary>
        /// <param name="LoginInfo"></param>
        /// <returns></returns>
        dynamic GetCompanys(UserAccount LoginInfo);

        /// <summary>
        /// 获取区域信息
        /// </summary>
        /// <param name="Code"></param>
        /// <returns></returns>
        Task<Area> GetAreaByCodeAsync(string Code);

        /// <summary>
        /// 获取基站信息
        /// </summary>
        /// <param name="predicate"></param>
        /// <returns></returns>
        Task<BaseStation> GetBaseStationFirstAsync(Expression<Func<BaseStation, bool>> predicate);

        /// <summary>
        /// 获取基站信息-分页
        /// </summary>
        /// <param name="predicate"></param>
        /// <param name="pageIndex">页面</param>
        /// <param name="pageSize">页数</param>
        /// <returns></returns>
        Task<List<BaseStation>> GetBaseStationListAsync(Expression<Func<BaseStation, bool>> predicate, int pageIndex, int pageSize);

        /// <summary>
        /// 获取工单计费信息
        /// </summary>
        /// <param name="predicate"></param>
        /// <returns></returns>
        Task<AnnFee> GetAnnFeeFirstAsync(Expression<Func<AnnFee, bool>> predicate);

        /// <summary>
        /// 获取工单计费信息
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Task<bool> AddAnnFeeFirstAsync(AnnFee entity);


        /// <summary>
        /// 获取工单信息
        /// </summary>
        /// <param name="predicate">条件</param>
        /// <returns></returns>
        Task<AnnounceList> GetAnnFirstOrDefaultAsync(Expression<Func<AnnounceList, bool>> predicate);

        /// <summary>
        /// 更新工单信息
        /// </summary>
        /// <param name="ann">更新的实体</param>
        /// <param name="UpdateColumn">更新的列</param>
        /// <returns></returns>
        bool UpdateAnnUpdateInclude(AnnounceList ann, string[] UpdateColumn);


        /// <summary>
        /// 获取状态类型
        /// </summary>
        /// <param name="predicate">条件</param>
        /// <returns></returns>
        Task<CommType> GetCommTypeFirstOrDefaultAsync(Expression<Func<CommType, bool>> predicate);

        /// <summary>
        /// 获取工单的所有发电记录id
        /// </summary>
        /// <param name="Anncode"></param>
        /// <returns></returns>
        Task<List<int>> GetAnnGenRecordIdAsync(string Anncode);

        /// <summary>
        /// 获取工单发电记录的列表
        /// </summary>
        /// <param name="predicate"></param>
        /// <returns></returns>
        Task<List<AnnounceGen>> GetAnnounceGenListAsync(Expression<Func<AnnounceGen, bool>> predicate);


        /// <summary>
        /// 添加工单操作记录
        /// </summary>
        /// <param name="entity"></param>
        Task<AnnounceStateXLog> AddAnnounceStateXLog(AnnounceStateXLog entity);

        /// <summary>
        /// 获取工单改中间表
        /// </summary>
        /// <param name="predicate">条件</param>
        /// <returns></returns>
        Task<List<ChangeAnnGenset>> GetChangeAnnGensetListAsync(Expression<Func<ChangeAnnGenset, bool>> predicate);

        /// <summary>
        /// 添加工单-绑定油机改中间表
        /// </summary>
        /// <param name="entity">条件</param>
        /// <returns></returns>
        Task<bool> AddChangeAnnGensetAsync(ChangeAnnGenset entity);

        /// <summary>
        /// 工单绑定
        /// </summary>
        /// <param name="predicate"></param>
        /// <returns></returns>
        Task<List<ReBinAnnGenset>> GetReBinAnnGensetListAsync(Expression<Func<ReBinAnnGenset, bool>> predicate);

        /// <summary>
        /// 添加-工单绑定油机改中间表
        /// </summary>
        /// <param name="entity">条件</param>
        /// <returns></returns>
        Task<bool> AddReBinAnnGensetAsync(ReBinAnnGenset entity);

        /// <summary>
        /// 添加-工单审核表
        /// </summary>
        /// <param name="entity">条件</param>
        /// <returns></returns>
        Task<bool> AddAnnounceAuditAsync(AnnounceAudit entity);

        /// <summary>
        /// 获取审核工单信息
        /// </summary>
        /// <param name="predicate"></param>
        /// <returns></returns>
        Task<AnnounceAudit> GetAnnounceAuditFirstAsync(Expression<Func<AnnounceAudit, bool>> predicate);

        /// <summary>
        /// 更新工单审核信息
        /// </summary>
        /// <param name="ann">更新的实体</param>
        /// <param name="UpdateColumn">更新的列</param>
        /// <returns></returns>
        public bool UpdateAnnounceAuditInclude(AnnounceAudit ann, string[] UpdateColumn);


        /// <summary>
        /// 获取审核工单信息
        /// </summary>
        /// <param name="predicate"></param>
        /// <returns></returns>
        Task<GenRecord> GetGenRecordFirstAsync(Expression<Func<GenRecord, bool>> predicate);

        /// <summary>
        /// 获取微信通知信息
        /// </summary>
        /// <param name="predicate"></param>
        /// <returns></returns>
         Task<WXEditor> GetWXEditorFirstAsync(Expression<Func<WXEditor, bool>> predicate);

        /// <summary>
        /// 获取用户
        /// </summary>
        /// <param name="predicate">条件</param>
        /// <returns></returns>
        Task<List<UserAccount>> GetUserAccountListAsync(Expression<Func<UserAccount, bool>> predicate);
       
        }
}
